cmake_minimum_required(VERSION 2.8)

SET(PRJ_NAME 				shrlib)

SET(PRJ_ROOTDIR				/home/jinquan/PROJECTS/shared_library)
SET(SRC_ROOTDIR 			/home/jinquan/PROJECTS/shared_library)

SET(cflags	-std=gnu99)
ADD_DEFINITIONS(${cflags})
PROJECT(${PRJ_NAME} 		C CXX)

MESSAGE(STATUS "--------------------------------------------------------")
MESSAGE(STATUS "Building shared library sample for Linux.")

INCLUDE_DIRECTORIES( 
	"${PRJ_ROOTDIR}" 
)

LINK_DIRECTORIES( 
	"${PRJ_ROOTDIR}/build"
	#"/opt/freeware/lib"
	#"/opt/freeware/lib/pthread/ppc64/"
	#"/opt/freeware/lib64/"
	#"/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.8.5/"
	#"/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.8.5/ppc64/"
)

SET(SRCLIST_shrlib
	${SRC_ROOTDIR}/shr.c
)


ADD_LIBRARY(shr SHARED ${SRCLIST_shrlib})
#ADD_LIBRARY(shr_shared SHARED ${SRCLIST_shrlib})
#set_target_properties( shr_shared
#		PROPERTIES
#		OUTPUT_NAME shr)

#add_custom_command(TARGET shr_shared		
#							POST_BUILD 	
#							#COMMAND "${CMAKE_COMMAND}" -E copy ${SRC_ROOTDIR}/bmc.h 		"$<TARGET_FILE_DIR:shr_shared>/../lib" 			VERBATIM
#							#COMMAND "${CMAKE_COMMAND}" -E copy libbmc.so 					"$<TARGET_FILE_DIR:shr_shared>/../lib/shared" 	VERBATIM
#							COMMAND "${CMAKE_COMMAND}" -E rename libshr.so					"$<TARGET_FILE_DIR:shr_shared>/libshr.a"		VERBATIM
#							)

#ADD_EXECUTABLE(sample  ${SRC_ROOTDIR}/sample.c )
#TARGET_LINK_LIBRARIES(sample  -lshr)